package demoMod.stsconsole.helpers;

import java.util.Random;

public class RandomSequence extends Random {
    public long counter;

    public RandomSequence(long seed) {
        super(seed);
    }

    public void resume() {
        long t = this.counter;
        this.counter = 0;
        for (long i = 0; i < t; i++) {
            nextInt();
        }
    }

    @Override
    protected int next(int bits) {
        counter++;
        return super.next(bits);
    }

    public boolean nextBoolean(float chance) {
        return nextFloat() < chance;
    }
}
